//
//  PosterDetialView.m
//  HuiWenMovie
//
//  Created by niceDay on 15/7/25.
//  Copyright (c) 2015年 computer. All rights reserved.
//

#import "PosterDetialView.h"
#import "UIImageView+WebCache.h"
@implementation PosterDetialView

- (id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
            }
    return  self;
}

- (void)awakeFromNib {
    
}


- (void)setModal:(messageModal *)modal{
    
    
    _modal = modal;
    _star = [[starView alloc] initWithFrame:_starView.bounds];
    [_starView addSubview:_star];

    _star.average = _modal.average;
    [self setNeedsLayout];
}

- (void)layoutSubviews{
    [super layoutSubviews];
    self.backgroundColor = [UIColor grayColor];
    [_imageView sd_setImageWithURL:[NSURL URLWithString:_modal.images[@"small"]]];
    _chineseNameLable.text = [NSString stringWithFormat:@"中文名 : %@",_modal.title];
    _chineseNameLable.numberOfLines = 2;
    _chineseNameLable.textColor = [UIColor blackColor];
    
    _scoreLable.text = [NSString stringWithFormat:@"%.1f",_modal.average];
    
    _yearLable.text = [NSString stringWithFormat:@"年份 : %@",_modal.year];
    _yearLable.textColor = [UIColor blackColor];
    _yearLable.numberOfLines = 2;
    
    
}
@end
